<html>
 <head>
  <link href="./leetcode-problem.css" rel="stylesheet" type="text/css">
 </head>
 <body>
  <div class="question_difficulty">
   难度：Easy
  </div>
  <div>
   <h1 class="question_title">
    7. Reverse Integer
   </h1>
   <p>
    Given a 32-bit signed integer, reverse digits of an integer.
   </p>
   <p>
    <strong>
     Example 1:
    </strong>
   </p>
   <pre>
<strong>Input:</strong> 123
<strong>Output:</strong> 321
</pre>
   <p>
    <strong>
     Example 2:
    </strong>
   </p>
   <pre>
<strong>Input:</strong> -123
<strong>Output:</strong> -321
</pre>
   <p>
    <strong>
     Example 3:
    </strong>
   </p>
   <pre>
<strong>Input:</strong> 120
<strong>Output:</strong> 21
</pre>
   <p>
    <strong>
     Note:
    </strong>
    <br>
    Assume we are dealing with an environment which could only store integers within the 32-bit signed integer range: [&minus;2
    <sup>
     31
    </sup>
    ,&nbsp; 2
    <sup>
     31&nbsp;
    </sup>
    &minus; 1]. For the purpose of this problem, assume that your function returns 0 when the reversed integer overflows.
   </p>
  </div>
  <div>
   <h1 class="question_title">
    7. 整数反转
   </h1>
   <p>
    给出一个 32 位的有符号整数，你需要将这个整数中每位上的数字进行反转。
   </p>
   <p>
    <strong>
     示例&nbsp;1:
    </strong>
   </p>
   <pre><strong>输入:</strong> 123
<strong>输出:</strong> 321
</pre>
   <p>
    <strong>
     &nbsp;示例 2:
    </strong>
   </p>
   <pre><strong>输入:</strong> -123
<strong>输出:</strong> -321
</pre>
   <p>
    <strong>
     示例 3:
    </strong>
   </p>
   <pre><strong>输入:</strong> 120
<strong>输出:</strong> 21
</pre>
   <p>
    <strong>
     注意:
    </strong>
   </p>
   <p>
    假设我们的环境只能存储得下 32 位的有符号整数，则其数值范围为&nbsp;[&minus;2
    <sup>
     31
    </sup>
    ,&nbsp; 2
    <sup>
     31&nbsp;
    </sup>
    &minus; 1]。请根据这个假设，如果反转后整数溢出那么就返回 0。
   </p>
  </div>
 </body>
</html>